from rest_framework.views import APIView
from rest_framework.response import Response
from dhm.models.roller_door.roller_door import RollerDoor

class RollerDoorView(APIView):
    def get(self, request):
        rollerdoor = RollerDoor.objects.all()
        roller_door_list = []
        for roller_door in rollerdoor:
            roller_door_list.append({
                'id': roller_door.id,
                'photo': roller_door.photo,
                'purpose_photo_one': roller_door.purpose_photo_one,
                'purpose_phone_two': roller_door.purpose_phone_two,
                'purpose_phone_three': roller_door.purpose_phone_three,
                'usage': roller_door.usage,
                'stock': roller_door.stock,
                'price': roller_door.price,
                'title': roller_door.title,
                'size': roller_door.size,
            })
        return Response(roller_door_list)

